#!/bin/bash

### 一步步安装cfssl ###
# 1. VERSION=1.9

# 2. [ -f go${VERSION}.linux-amd64.tar.gz ] || wget https://storage.googleapis.com/golang/go${VERSION}.linux-amd64.tar.gz

# 3. tar xf go${VERSION}.linux-amd64.tar.gz -C /usr/local

# 4. echo "export PATH=$PATH:/usr/local/go/bin" > $HOME/.profile

# 5. source $HOME/.profile

# 6. export GOPATH=/opt/gopath

# 7. go get -u github.com/cloudflare/cfssl/cmd/...

# 8. mv /opt/gopath/bin/{cfssl, cfssljson, cfssl-certinfo}  /usr/local/bin/


### 直接以二进制的形式,安装 cfssl ###
[ -f cfssl.tgz ] || wget https://gitee.com/yonchin/cfssl/raw/master/cfssl.tgz
tar xf cfssl.tgz -C /usr/local/bin/
